package bsh.compilation;

import java.util.EnumSet;
import java.util.Set;

/**
 * {@link CompilationOptions} padrao. Inclui todas as opcoes de debug, menos {@link DebugOptions#COMMENTS_AS_LDC}, nao permite acessar
 * variaveis nao definidas e nao faz inline de constantes.
 * 
 * @author takeshi
 */
public class DefaultCompilationOptions implements CompilationOptions {

    /**
     * {@inheritDoc}
     */
    public boolean allowUndefinedVariables() {
        return true;
    }

    /**
     * {@inheritDoc}
     */
    public Set<DebugOptions> debugOptions() {
        final EnumSet<DebugOptions> set = EnumSet.allOf(DebugOptions.class);
        set.remove(DebugOptions.COMMENTS_AS_LDC);
        return set;
    }

    /**
     * {@inheritDoc}
     */
    public boolean declareThrowsException() {
        return true;
    }

    /**
     * {@inheritDoc}
     */
    public boolean initializeLocalVariables() {
        return true;
    }

    /**
     * {@inheritDoc}
     */
    public boolean inlineConstants() {
        return false;
    }

}
